<?php
use app\models\Mall;
use app\widgets\MallMBottomToolbarWidget;
use yii\helpers\Url;

$web = Url::base();
$institution_code = Mall::getCurrentInstitutionCode();
$site_name = \app\models\Mall::getCurrentInstitutionSiteName();
$header = \app\models\Mall::getCurrentUser()['header_url'];
$this->title = $site_name . '-个人中心';
?>

<link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall-m/user-center.css"/>

<div class="main">
    <div class="header">
        <a href="javascript:history.back();">
            <div class="go-back f-l">
                <img src="<?= $web ?>/images/mall-m/go-back-w.png"/>
            </div>
        </a>
        <p class="center">个人中心</p>
        <a href="index?institution_code=<?=$institution_code?>">
            <div class="go-index">
                <img src="<?= $web ?>/images/mall-m/index-icon.png"/>
            </div>
        </a>
        <p class="account">账号：<span><?= $user['name'] ?></span></p>
        <a href="logout">
            <p class="exit">退出登录</p>
        </a>
        <div class="avatar">
            <?php
            if (empty($header)) {
                echo "<img src='{$web}/images/mall-m/head-portrait.png' />";
            } else {
//                echo "<img src='{$web}/images/mall-m/head-portrait.png' />";
                echo "<img src='$header' />";
            }
            ?>
        </div>
    </div>
    <div class="record">
        <a href="" style="visibility: hidden;">
            <div class="footprint f-l">
                <img src="<?= $web ?>/images/mall-m/footprint-icon.png"/>
                <p>足迹</p>
            </div>
        </a>
        <a href="" style="visibility: hidden;">
            <div class="wish f-l">
                <img src="<?= $web ?>/images/mall-m/wish-icon.png"/>
                <p>心愿单</p>
            </div>
        </a>
        <a href="" style="visibility: hidden;">
            <div class="collect f-l">
                <img src="<?= $web ?>/images/mall-m/collect.png"/>
                <p>收藏</p>
            </div>
        </a>
    </div>
    <div class="order">
        <a href="order-list?institution_code=<?=$institution_code?>">
            <div class="my-order">
                <img class="order-icon f-l" src="<?= $web ?>/images/mall-m/order-icon.png"/>
                <p class="title f-l">我的订单</p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
                <p class="hint f-r">查看我的全部订单</p>
            </div>
        </a>
        <div class="state" style="display:none;">
            <a href="">
                <div class="pay f-l">
                    <img src="<?= $web ?>/images/mall-m/pay-icon.png"/>
                    <p>待付款</p>
                </div>
            </a>
            <a href="">
                <div class="receipt f-l">
                    <img src="<?= $web ?>/images/mall-m/receipt-icon.png"/>
                    <p>待收货</p>
                </div>
            </a>
            <a href="">
                <div class="returns f-l">
                    <img src="<?= $web ?>/images/mall-m/returns-icon.png"/>
                    <p>退货/退款</p>
                </div>
            </a>
        </div>
    </div>
    <div class="personal">
        <a href="user-integral-record?institution_code=<?=$institution_code?>">
            <div class="integrals">
                <img class="integration-icon f-l" src="<?= $web ?>/images/mall-m/integration-icon.png"/>
                <p class="f-l">我的<?= $integral_uint ?></p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
                <p class="integral-value f-r"><?= floor($integral) ?></p>

            </div>
        </a>
        <a href="integral-transfer?institution_code=<?=$institution_code?>">
            <div class="serve">
                <img class="serve-icon f-l" src="<?= $web ?>/images/mall-m/donation-icon.png"/>
                <p class="f-l">积分转赠</p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
            </div>
        </a>
        <a href="http://m.fanso2o.com/home/index2?v=3">
            <div class="serve">
                <img class="serve-icon f-l" src="<?= $web ?>/images/mall-m/user-center-virtual-goods-icon.png"/>
                <p class="f-l">我的卡卷</p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
            </div>
        </a>
        <a href="after-sale-service?institution_code=<?=$institution_code?>">
            <div class="serve">
                <img class="serve-icon f-l" src="<?= $web ?>/images/mall-m/after-sale.png"/>
                <p class="f-l">售后服务</p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
            </div>
        </a>
        <a href="feedback" style="display: none;">
            <div class="idea">
                <img class="idea-icon f-l" src="<?= $web ?>/images/mall-m/idea-icon.png"/>
                <p class="f-l">意见反馈</p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
            </div>
        </a>
        <a href="user-address-list?institution_code=<?=$institution_code?>">
            <div class="address">
                <img class="address-icon f-l" src="<?= $web ?>/images/mall-m/address-icon.png"/>
                <p class="f-l">收货地址</p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
            </div>
        </a>
        <a href="tel:400--860--3111">
            <div class="phone">
                <img class="phone-icon f-l" src="<?= $web ?>/images/mall-m/phone-icon.png"/>
                <p class="f-l">400-860-3111 (服务时间：周一到周五9:00-18:00)</p>
                <img class="a-icon f-r" src="<?= $web ?>/images/mall-m/a-icon.png"/>
            </div>
        </a>
        <div style="width: 100%; height: 3rem; background-color: #ffffff;"></div>
    </div>
    <?=MallMBottomToolbarWidget::widget(['actionName'=>'user'])?>
</div>
